#include <iostream>
#include <cmath>
#define PRINTARRAY(array, n) \
for (int i = 0; i < (n); i++) \
    std::cout << "array[ " << i << " ] = " << (array)[i] << std::endl;



int vabs(int * p, int n)
{
    for(int i = 0; i < n; i++)
    {
        p[i] = abs(p[i]);
    }
}

float vabs(float * p, int n)
{
    for(int i = 0; i < n; i++)
    {
        p[i] = fabs(p[i]);
    }
}

double vabs(double * p, int n)
{
    for(int i = 0; i < n; i++)
    {
        p[i] = fabs(p[i]);
    }
}
int main()
{
    int array[7] = {-1,2,-3,4,5,-6,7};
    float array2[7] = {-1.2f, -2.2f, -8.f, 8.f, -9.9f, -9.2f, -8.2f};
    double array3[7] = {3.2, -5.3, 96., -96.1, 8., 8.2, 8.9};

    vabs(array, 7);
    PRINTARRAY(array, 7)

    vabs(array2, 7);
    PRINTARRAY(array2, 7)

    vabs(array3, 7);
    PRINTARRAY(array3, 7)

}